#!/usr/bin/env python
try:
    import json
except:
    from helper import HelpJson as json
import sys
import class_set
import helper

class FriendListMapper(helper.MapperHelper):
    def mapper(self):
        for line in sys.stdin:
            key, value = self.loader(line)
            node = class_set.UserNode()
            node.init(value)
            if node.getType() != 'delstars':
                self.allocator(self.join(key, node.getId()), class_set.RecomTag('1'))
                self.allocator(self.join(node.getId(), key), class_set.RecomTag('2'))
            else:
                pass

def main():
    fm = FriendListMapper()
    fm.mapper()

if __name__ == '__main__':
    main()
    
